import request from '../../api/base'

export function getMemberDistributeLeaveList(date) {
  let data = {pageSize: 100, pageNum: 1, date};
  return  request({
    method: 'post',
    url: 'api/member/api-member/memberLeave/getMemberDistributeLeaveList',
    data: data,
  }).then(res => {
    if (res.flag){
      return res.data
    }
    return [];
  })
}

export function deleteDistributeLeave(id) {
  return  request({
    method: 'delete',
    url: 'api/member/api-member/memberLeave/deleteDistributeLeave',
    data: {id},
    requestType: 'form'
  }).then(res => res)
}

export function getRealLeaveDay(data) {
  return  request({
    method: 'post',
    url: 'api/member/api-member/memberLeave/getRealLeaveDay',
    data: {...data},
  }).then(res => {
    if (res.flag){
      return res.data
    }
  })
}

export function saveOrUpdateDistributeLeave(data) {
  return  request({
    method: 'post',
    url: 'api/member/api-member/memberLeave/saveOrUpdateDistributeLeave',
    data: data,
  }).then(res => res)
}


